use std::collections::HashSet;

struct Solution {}

fn main() {}

impl Solution {
    pub fn min_operations(nums: Vec<i32>, k: i32) -> i32 {
        let mut nums_set = HashSet::<&i32>::from_iter(nums.iter());
        let min_num: i32 = **nums_set.iter().min().unwrap();
        if k > min_num {
            return -1;
        }
        if k == min_num {
            return nums_set.len() as i32 - 1;
        }
        nums_set.len() as i32
    }
}
